Question: $f(x, y) = \left( -x^2, y \right)$ What is the divergence of $f$ at $(3, -1)$ ?
Answer: The formula for divergence in two dimensions is $\text{div}(f) = \dfrac{\partial P}{\partial x} + \dfrac{\partial Q}{\partial y}$, where $P$ is the $x$ -component of $f$ and $Q$ is the $y$ -component. Let's differentiate! $\begin{aligned} \dfrac{\partial P}{\partial x} &= \dfrac{\partial}{\partial x} \left[ -x^2 \right] \\ \\ &= -2x \\ \\ \dfrac{\partial Q}{\partial y} &= \dfrac{\partial}{\partial y} \left[ y \right] \\ \\ &= 1 \end{aligned}$ Adding the two partial derivatives, $\text{div}(f) = -2x + 1$. The divergence of $f$ at $(3, -1)$ is $-5$.